﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>超市后台管理系统-分部</title>
    <!-- Bootstrap Styles-->
    <link href="/static/sm_assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="/static/sm_assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="/static/sm_assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="/static/sm_assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='http://fonts.useso.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <!-- TABLE STYLES-->
    <link href="/static/sm_assets/js/dataTables/dataTables.bootstrap.css" rel="stylesheet" />

</head>

<body>
    <div id="wrapper">
        <nav class="navbar navbar-default top-navbar" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand public-header" href="/sm_system/">超市后台管理系统-分部</a>
            </div>

            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                        <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li class="divider"></li>
                        <li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
        </nav>
        <!--/. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <!-- <ul class="nav" id="main-menu">
                    <li>
                        <a href="commodity.html"><i class="fa fa-sitemap"></i>商品管理</a>
                    </li>
                    <li>
                        <a href="provider.html"><i class="fa fa-bar-chart-o"></i> 供应商管理</a>
                    </li>
                    <li>
                        <a href="contract.html"><i class="fa fa-qrcode"></i> 合同管理</a>
                    </li>
                    
                    <li>
                        <a href="sale.html"><i class="fa fa-table"></i> 销售信息</a>
                    </li>
                    <li>
                        <a href="customer.html"><i class="fa fa-sitemap"></i> 会员管理</a>
                    </li>

                    <li>
                        <a href="staff.html"><i class="fa fa-fw fa-file"></i> 职员信息</a>
                    </li>
                </ul> -->

            </div>
        </nav>
        <!-- /. NAV SIDE  -->
        
        <!-- /. NAV SIDE  -->
        <div id="page-wrapper">
            <div id="page-inner">
                <div class="row">
                    <div class="col-md-12">
                        <h1 class="page-header">
                            商品信息 <small>商品基本信息</small>
                        </h1>
                    </div>
                </div>
                <!-- /. ROW  -->
                <div class="row">
                    <a href="/commodity/add/" class="add-button">添加商品信息</a>
                </div>
                <div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             Commodity Information
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>id</th>
                                            <th>名称</th>
                                            <th>商品进价</th>
                                            <th>商品售价</th>
                                            <th>商品品牌编号</th>
                                            <th>商品种类编号</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% for commodity in commoditys %}
                                        <tr class="odd gradeX">
                                            <td>{{ commodity.id }}</td>
                                            <td>{{ commodity.name }}</td>
                                            <td>{{ commodity.pur_price}}</td>
                                            <td>{{ commodity.sell_price}}</td>
                                            <td>{{ commodity.brand_id}}</td>
                                            <td>{{ commodity.type_id}}</td>
                                            <td class="center">
                                                <a href="/commodity/update/{{ commodity.id }}/"><img src="/static/sm_assets/img/xiugai.png" alt="修改" title="修改"></a>
                                                <a href="#" class="removeProvider" commodityid="{{ commodity.id }}"><img src="/static/sm_assets/img/schu.png" alt="删除" title="删除"></a>
                                            </td>
                                        </tr>
                                    {%  endfor %}
                                    </tbody>
                                </table>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>


                <!-- /. ROW  -->
                <footer><p>Copyright &copy; 2016.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p></footer>
            </div>
            <!-- /. PAGE INNER  -->
        </div>
        <!-- /. PAGE WRAPPER  -->
    </div>
    <div class="zhezhao" ></div>
    <div class="remove" id="removeProv">
        <div class="removerChid">
            <h2>提示</h2>
            <div class="removeMain">
                <p>你确定要删除该商品吗？</p>
                <a href="#" id="yes">确定</a>
                <a href="#" id="no">取消</a>
            </div>
        </div>
   </div>
    <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="/static/sm_assets/js/jquery-1.10.2.js"></script>
    <!-- Bootstrap Js -->
    <script src="/static/sm_assets/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="/static/sm_assets/js/jquery.metisMenu.js"></script>
     <!-- DATA TABLE SCRIPTS -->
    <script src="/static/sm_assets/js/dataTables/jquery.dataTables.js"></script>
    <script src="/static/sm_assets/js/dataTables/dataTables.bootstrap.js"></script>
    <script>
        $(document).ready(function () {
            $('#dataTables-example').dataTable();
        });

        $(function () {
            $('.removeProvider').click(function () {
                id =$(this).attr('commodityid')
                $('#yes').attr('href','/commodityid/delete/'+id+'/')
                $('.zhezhao').css('display', 'block');
                $('#removeProv').fadeIn();
            });

        });

        $(function () {
            $('#no').click(function () {
            $('.zhezhao').css('display', 'none');
            $('#removeProv').fadeOut();
            });
        });

    </script>
         <!-- Custom Js -->
    <!-- Custom Js -->
    <script src="/static/sm_assets/js/custom-scripts.js"></script>


</body>

</html>